package com.share.device.mqtt.handler.impl;

import com.alibaba.fastjson2.JSONObject;


import com.share.device.mqtt.annotation.ShareEmqx;
import com.share.device.mqtt.constant.EmqxConstants;
import com.share.device.mqtt.handler.MassageHandler;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Component
@ShareEmqx(topic = EmqxConstants.TOPIC_POWERBANK_LOCK)
public class PowerBankLockHandler implements MassageHandler {


    /**
     * 处理消息:
     *  充电宝插入柜机，连接上线，有两种情况
     *      1， 无订单，初始化插入
     *      2， 有订单，归还充电宝
     * @param message
     * {"messageNo":"112233","cabinetNo":"xgxgxxxg","powerBankNo":"gg001",
     * "slotNo":"1", "electricity": 85}
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void handleMessage(JSONObject message) {

    }
}

